package com.pzb.wechat.mapper;

import java.util.List;
import com.pzb.wechat.domain.WechatAddress;
import org.apache.ibatis.annotations.Param;

/**
 * 收货地址Mapper接口
 * 
 * @author Mr_Wu
 * @date 2022-01-21
 */
public interface WechatAddressMapper 
{
    /**
     * 查询收货地址
     * 
     * @param id 收货地址主键
     * @return 收货地址
     */
    public WechatAddress selectWechatAddressById(Long id);

    /**
     * 查询收货地址列表
     * 
     * @param
     * @return 收货地址集合
     */
    public List<WechatAddress> selectWechatAddressList(@Param("openid") String openid, @Param("extAppid")String extAppid);

    Long selectAddressDefaultId(@Param("openid") String openid, @Param("extAppid")String extAppid);

    int setAddressIsNotDefault(@Param("openid") String openid, @Param("extAppid")String extAppid);

    WechatAddress selectWechatDefaultAddress(@Param("openid") String openid, @Param("extAppid")String extAppid);

    int setAddressDefault(Long id);
    /**
     * 新增收货地址
     * 
     * @param wechatAddress 收货地址
     * @return 结果
     */
    public int insertWechatAddress(WechatAddress wechatAddress);

    /**
     * 修改收货地址
     * 
     * @param wechatAddress 收货地址
     * @return 结果
     */
    public int updateWechatAddress(WechatAddress wechatAddress);

    /**
     * 删除收货地址
     * 
     * @param id 收货地址主键
     * @return 结果
     */
    public int deleteWechatAddressById(Long id);

    /**
     * 批量删除收货地址
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWechatAddressByIds(Long[] ids);

}
